<html lang="zh-cn" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<th:block th:fragment="header">
    <!--header-->
    <header id="header">
        <nav id="main-nav" class="navbar navbar-default navbar-fixed-top" role="banner">
            <div class="container">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <a class="navbar-brand" href="/">
                        <img th:src="${config.homeLogo}" alt="logo" width="150" height="50">
                    </a>
                </div>
                <div class="collapse navbar-collapse navbar-right">
                    <ul class="nav navbar-nav">
                        <li class="scroll ">
                            <a href="/">首页</a>
                        </li>
                        <li class="scroll">
                            <a href="/quickpass">测试</a>
                        </li>
                        <li class="scroll">
                            <a href="/doc.do">文档</a>
                        </li>
                        <th:block th:if="${session.userInfo == null}">
                            <li class="scroll ">
                                <a href="/admin/login">登录</a>
                            </li>
                            <li class="scroll">
                                <a href="/register">注册</a>
                            </li>
                        </th:block>
                        <th:block th:if="${session.userInfo != null}">
                            <li class="scroll ">
                                <a href="/admin" style="color: darkgreen;"
                                   th:text="'用户:'+ ${session.userInfo.user}"></a>
                            </li>
                        </th:block>
                    </ul>
                </div>
            </div>
        </nav>
    </header>
</th:block>
</html>